home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import com.sun.java.swing.AbstractAction;
- import java.awt.event.ActionEvent;
- import java.io.Serializable;
-
- class BasicTreeUI$TreeToggleAction extends AbstractAction implements Serializable {
- // $FF: synthetic field
- BasicTreeUI this$0;
-
- // $FF: synthetic method
- public BasicTreeUI$TreeToggleAction(BasicTreeUI this$0, String name) {
- super(name);
- this.this$0 = this$0;
- }
-
- public void actionPerformed(ActionEvent e) {
- if (this.this$0.tree != null) {
- int selRow = this.this$0.tree.getMinSelectionRow();
- if (selRow != -1 && !this.this$0.isLeaf(selRow)) {
- if (this.this$0.isExpanded(selRow)) {
- this.this$0.collapseRow(selRow);
- } else {
- this.this$0.expandRow(selRow);
- }
- }
- }
-
- }
-
- public boolean isEnabled() {
- return this.this$0.tree != null && this.this$0.tree.isEnabled();
- }
- }
-